<html>
<head>
<script language="JavaScript" type="text/javascript">
	function checkform ( form )
	{
		if (form.quantity.value == "") {
			alert( "Please enter the number of items." );
			form.quantity.focus();
			return false ;
		}
		if (isNaN(form.quantity.value)) {
			alert( "Please enter a positive number." );
			form.quantity.focus();
			return false ;
		}
		if (form.quantity.value <= 0) {
			alert( "Please enter a positive number." );
			form.quantity.focus();
			return false ;
		}
		return true ;
	}
</script>
</head>
<?php
	$item = $_GET['item'];
?>

<body>
	<form action="modify_item_info.php" target="output_panel" method="post">
	<fieldset>
		<legend>Modify Item</legend>
		<table border="0">
			<tr>
				<td>Item Name: </td>
				<td><input type="text" size=20 name="item_name" value="<?php echo $item;?>" disabled="disabled"/></td>
			</tr>
			<tr>
				<td></td>
				<td><input type="submit" value="SEARCH" disabled="disabled"/></td>
			</tr>
		</table>
	</fieldset>
	</form>
	<form action="take_itemqty_info.php?item=<?php echo $item;?>" target="output_panel" method="post" onsubmit="return checkform(this);">
	<fieldset>
		<legend>Take Some</legend>
		<table border="0">
			<tr>
				<td>Quantity: </td>
				<td><input type="text" size=20 name="quantity"/></td>
			</tr>
			<tr>
				<td>Client: </td>
				<td><select name="taker">
						<option value="Teacher Mark">Teacher Mark</option>
						<option value="Teacher Jinky">Teacher Jinky</option>
						<option value="Ate Thess">Ate Thess</option>
						<option value="Kuya Juni">Kuya Juni</option>
						<option value="Student">Student</option>
					</select>
				</td>
			</tr>
			<tr>
				<td>Purpose: </td>
				<td><select name="purpose">
						<option value="Pre School">Pre School</option>
						<option value="Elementary">Elementary</option>
						<option value="High School">High School</option>
						<option value="General">General</option>
					</select>
				</td>
				<td><b>NOTE: </b>Only Food Items should have <i>General</i> as its Purpose.</td>
			</tr>
			<tr>
				<td></td>
				<td><input type="submit" value="TAKE" /></td>
			</tr>
		</table>
	</fieldset>
	
	</form>
	<form action="modify_item.php" method="post">
		<input type="submit" value="Modify Another Item" />
	</form>
</body>
</html>